<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>三栏布局</title>
    <link rel="stylesheet" href="">
    <style type="text/css" media="screen">
        html * {
            margin: 0;
            padding: 0;
        }
    </style>
</head>

<body>
    <!-- 1.flex1  2.float 3.position 4.table-cell 5.grid -->
    <section class="layout float">
        <style type="text/css" media="screen">
            .layout.float .wrapper>div {
                height: 100px;
            }

            .layout.float .left {
                float: left;
                width: 300px;
                background: red;
            }

            .layout.float .center {
                background: yellow;
            }

            .layout.float .right {
                float: right;
                width: 300px;
                background: blue;
            }
        </style>
        <article class="wrapper">
            <div class="left"></div>
            <div class="right"></div>
            <div class="center">
                <h1>float布局</h1>
                1.我是float布局的中间部分
                2.我是float布局的中间部分
            </div>
        </article>
    </section>


    <section class="layout absolute">
        <style type="text/css" media="screen">
            .layout.absolute .wrapper {
                width: 100%;
                margin-top: 20px;
            }

            .layout.absolute .wrapper>div {
                min-height: 100px;
            }

            .layout.absolute .left {
                position: absolute;
                left: 0;
                width: 300px;
                background: red;
            }

            .layout.absolute .center {
                position: absolute;
                left: 300px;
                right: 300px;
                background: yellow;
            }

            .layout.absolute .right {
                position: absolute;
                right: 0;
                width: 300px;
                background: blue;
            }
        </style>
        <article class="wrapper">
            <div class="left"></div>
            <div class="center">
                <h1>absolute布局</h1>
                1.我是absolute布局的中间部分
                2.我是absolute布局的中间部分
            </div>
            <div class="right"></div>
        </article>
    </section>


    <section class="layout flex">
        <style type="text/css" media="screen">
            .layout.flex .wrapper {
                width: 100%;
                min-height: 100px;
                display: flex;
                margin-top: 140px;
            }

            .layout.flex .left {
                width: 300px;
                background: red;
            }

            .layout.flex .center {
                flex: 1;
                background: yellow;
            }

            .layout.flex .right {
                width: 300px;
                background: blue;
            }
        </style>
        <article class="wrapper">
            <div class="left"></div>
            <div class="center">
                <h1>flex布局</h1>
                1.我是flex布局的中间部分
                2.我是flex布局的中间部分
            </div>
            <div class="right"></div>
        </article>
    </section>


    <section class="layout table">
        <style type="text/css" media="screen">
            .layout.table .wrapper {
                display: table;
                width: 100%;
                min-height: 100px;
                margin-top: 20px;
            }

            .layout.table .left {
                display: table-cell;
                width: 300px;
                background: red;
            }

            .layout.table .center {
                display: table-cell;
                background: yellow;
            }

            .layout.table .right {
                display: table-cell;
                width: 300px;
                background: blue;
            }
        </style>
        <article class="wrapper">
            <div class="left"></div>
            <div class="center">
                <h1>table布局</h1>
                1.我是table布局的中间部分
                2.我是table布局的中间部分
            </div>
            <div class="right"></div>
        </article>
    </section>


    <section class="layout grid">
        <style type="text/css" media="screen">
            .layout.grid .wrapper {
                display: grid;
                grid-template-columns: 300px auto 300px;
                grid-template-rows: 100px;
                width: 100%;
                margin-top: 20px;
            }

            .layout.grid .left {
                background: red;
            }

            .layout.grid .center {
                background: yellow;
            }

            .layout.grid .right {
                background: blue;
            }
        </style>
        <article class="wrapper">
            <div class="left"></div>
            <div class="center">
                <h1>grid布局</h1>
                1.我是grid布局的中间部分
                2.我是grid布局的中间部分
            </div>
            <div class="right"></div>
        </article>
    </section>
</body>

</html>